#pragma once
#include"Texture.h"
#include"TextureSection.h"
#include"Timer.h"



class Animation
{
private:
	std::vector<TextureSection*> frames;
	std::vector<float> delays;
	float lastupdate;
	bool active;
	unsigned int currentframe;
	Timer* timer;
	unsigned int id;
public:
	Animation();
	~Animation();
	bool PushFrame(TextureSection* , float);
	void Play();
	void Pause();
	void PlayPause();
	void Update();
	bool DrawAnimation(int X, int Y, GLfloat Scale = 1,GLfloat Rotation = 0, GLfloat red = 1.0f, GLfloat green = 1.0f, GLfloat blue = 1.0f);
	unsigned int GetId();
	unsigned int SetId( unsigned int );
};